﻿using ModelLayer;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace DataAccessObjectLayer
{
    internal interface IDBPartRoute
    {
        /// <summary>
        /// Gets all part routes from the database.
        /// </summary>
        /// <param name="routeId">The route identifier.</param>
        /// <returns>List{PartRoute}.</returns>
        List<PartRoute> GetAllPartRoutes(long routeId);

        /// <summary>
        /// Gets a part route from the database from an id.
        /// </summary>
        /// <param name="partRouteId">The part route identifier.</param>
        /// <returns>PartRoute.</returns>
        PartRoute GetPartRoute(long partRouteId);

        /// <summary>
        /// Inserts a part route in the database and associates it to a route.
        /// </summary>
        /// <param name="partRoute">The part route.</param>
        /// <param name="routeId">The route identifier.</param>
        /// <param name="transaction">The transaction.</param>
        /// <returns>the number of affected rows</returns>
        /// <exception cref="System.Exception">The partroute was not inserted</exception>
        int InsertPartRoute(PartRoute partRoute, long routeId, SqlTransaction transaction);

        /// <summary>
        /// Updates a part route in the database associated to a route.
        /// </summary>
        /// <param name="partRoute">The part route.</param>
        /// <param name="routeId">The route identifier.</param>
        /// <returns>the number of affected rows</returns>
        /// <exception cref="System.Exception">The partroute was not updated</exception>
        int UpdatePartRoute(PartRoute partRoute, long routeId);

        /// <summary>
        /// Removes a part route from the database.
        /// </summary>
        /// <param name="partRouteId">The part route identifier.</param>
        /// <returns>the number of affected rows</returns>
        /// <exception cref="System.Exception">The partroute was not removed</exception>
        int RemovePartRoute(long partRouteId);
    }
}